﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：RedisCacheModule.cs
// 功能描述：TongTongMall.Redis
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using System.Reflection;
using TongTongMall;
using TongTongMall.Dependecy;
using TongTongMall.Modules;
using TongTongMall.Redis.Cache.Configuration;
using TongTongMall.Runtime.Caching;

namespace TongTongMall.Redis.Cache
{
    /// <summary>
    /// redis模块
    /// </summary>
    [DependsOn(typeof(KernelModule))]
    public class RedisCacheModule : BaseModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
        }

        public override void PreInitialize()
        {
            IocManager.Register<IRedisCache, RedisCache>();

            IocManager.RegisterIfNot<IRedisConfiguration, RedisConfiguration>();
        }
    }
}
